package com.atguigu.spzx.product.mapper;

import com.atguigu.spzx.model.dto.api.ApiProductSearchDTO;
import com.atguigu.spzx.model.entity.product.ProductSku;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductSkuMapper extends BaseMapper<ProductSku> {
    //mp自定义sql中使用分页查询时，只需要传入设置了pageNum pageSize的page对象，mp会自动生成分页的sql
    List<ProductSku> selectListByCondition(Page<ProductSku> page,
                                           @Param("productSearchDTO") ApiProductSearchDTO productSearchDTO);

    List<ProductSku> selectListByCondition2(Page<ProductSku> page,
                    //mp使用QueryWrapper携带条件时，必须使用@Param("ew") 取别名 别名名称必须为ew
                                            @Param("ew")QueryWrapper queryWrapper);
}
